package com.qcby.llmtchstd.service.Impl;

import com.qcby.llmtchstd.common.ResponseResult;
import com.qcby.llmtchstd.dao.ExamPaperDao;
import com.qcby.llmtchstd.entity.Exam;
import com.qcby.llmtchstd.entity.Student;
import com.qcby.llmtchstd.service.ExamPaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExamPaperServiceImpl implements ExamPaperService {

    @Autowired
    private ExamPaperDao examPaperDao;

    @Override
    public ResponseResult selectById(Long id) {
        try {
            Exam exam= examPaperDao.selectById(id);
            return ResponseResult.success(exam);
        }
        catch (Exception e){
            e.printStackTrace();//打印异常到控制台
            return ResponseResult.dbError("数据库异常：查询试卷失败");
        }
    }
}
